package com.mdxl;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;

@SpringBootApplication(scanBasePackages = {"com.mdxl"})
public class MongoApplication {

	public static void main(String[] args) {
		SpringApplication.run(MongoApplication.class, args);
	}
	@Bean
	public CommandLineRunner commandLineRunner(ApplicationContext ctx){
		return args ->{
			System.out.println("Let's inspect the beans provided by Spring Boot:");
			System.out.println("这个项目是关于对mongodb操作[CRUD]的的几种写法：");
			System.out.println("1基于DBObject!");
			System.out.println("2基于Repository");
			System.out.println("3基于MongoTemplete,Query!");
			System.out.println("4基于MongoClient,获取一系列db，collection又回到first包下的封装类中");
			System.out.println("博客社区：https://my.oschina.net/u/3209213");
			System.out.println("未完待续.....");
			/*String[] beanNames = ctx.getBeanDefinitionNames();
            Arrays.sort(beanNames);
            for (String beanName : beanNames) {
                System.out.println(beanName);
            }*/
		};

	}
}
